﻿@model ViewModels.RecruitInfoVM.RecruitInfoMainVM
@{
    ViewBag.Title = "Hinoky.com :::: 요새 일거리 좀 있능가?";
}

<script src="~/Scripts/Chart.js"></script>
<script src="~/Scripts/customJS/guestbookLib.js"></script>
<script type="text/javascript">
    
    $(document).ready(function () {
        var resultData;

        $.ajax({
            type: "GET",
            async: false,
            url: "/recruitinfo/getdata",
            datatype: 'json',
            traditional: true,
            success: function (data) {
                if (data.ResultData) {
                    resultData = data.ResultData;
                }
                else {
                    console.log(data);
                }
            },
            beforeSend: function () {
                //showLoadingLayer();
            },
            complete: function () {
                //hideLoadingLayer();
            },
            error: function (xhr, status, error) {
                alert(error);
            }
        });

        //$("#canvas").css("width", $("#canvas").parent().css("width").replace("px", ""));

        //for (var i = 0; i < resultData.XAxisList.length; i++) {
        //    if (i % 3 != 0)
        //        resultData.XAxisList[i] = "";
        //}

        var lineChartData = {
            labels: resultData.XAxisList,
            datasets: [
                {
                    fillColor: "rgba(220,220,220,0.0)",
                    strokeColor: "rgba(000,000,255,1)",
                    pointColor: "rgba(000,000,255,1)",
                    pointStrokeColor: "#fff",
                    data: resultData.RecruitInfoSeriesListForChart[0].RecruitCounts
                },
                {
                    fillColor: "rgba(151,187,205,0.0)",
                    strokeColor: "rgba(255,000,000,1)",
                    pointColor: "rgba(255,000,000,1)",
                    pointStrokeColor: "#fff",
                    data: resultData.RecruitInfoSeriesListForChart[1].RecruitCounts
                }
            ]
        }

        var lineChartOption = {
            scaleOverlay: true,
            scaleOverride:true,
            //** Required if scaleOverride is true **
            //Number - The number of steps in a hard coded scale
            scaleSteps : 5,
	        //Number - The value jump in the hard coded scale
            scaleStepWidth : 200,
            //Number - The scale starting value

        }

        var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData, lineChartOption);
    });

    guestbookLib({ locationCode: 'RECRUIT', subKey: '0', addButtonName: 'btnGuestbookAdd', isAjaxCall: true, isUseSecret: false });

</script>

<div class="bs-callout bs-callout-info title-area">
    <div>
        <h3>국내 구인 추세</h3>
        <p />
        <p>
            자동 웹사이트 수집을 통해 매일 특정 영역의 구인 현황을 제공해 드리고 있습니다. <br /> 
            위 정보의 수집은 <b>'방문자수 1위' 사람중심 취업사이트 <a href="http://www.saramin.co.kr/zf_user/" target="_blank">사람인</a> </b>을 기반으로 이뤄지고 있습니다. 
        </p>
    </div>
</div>

<div class="row" >
    <span class="h3 glyphicon glyphicon-stats" style="padding-left:10px">&nbsp;Graph</span>
</div>

<div class="row">
    <div class="col-sm-10">
        <canvas id="canvas" height="350" width="1000" style="border:1px solid #000000; margin:20px; padding:10px; border-radius:10px" ></canvas>
    </div>
    <div class="col-sm-2" style="padding:35px">
        <span style="color:red">■</span> Java 웹 개발 <br /><span style="color:blue">■</span> .Net 웹 개발
    </div>
</div>

<div class="row" >
    <span class="h3 glyphicon glyphicon-stats" style="padding-left:10px">&nbsp;Data</span>
</div>

<div class="row">
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th class="col-md-3 text-center">날짜</th>
                <th class="col-md-3 text-center">Java 웹 개발</th>
                <th class="col-md-3 text-center">.Net 웹 개발</th>
                <th class="col-md-3 text-center">합계(Java + .Net)</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.RecruitInfoListForGrid)
            {
                <tr>
                    <td class="col-md-3 text-center">@item.BaseDate</td>
                    <td class="col-md-3 text-right">@Convert.ToDecimal(item.DevWebJava).ToString("##,###")</td>
                    <td class="col-md-3 text-right">@Convert.ToDecimal(item.DevWebNet).ToString("##,###")</td>
                    <td class="col-md-3 text-right">@Convert.ToDecimal(item.DevWebTotal).ToString("##,###")</td>
                </tr>   
            }
        </tbody>
    </table>
</div>
<p />

<div class="well">
    <div class="row">
        <div class="col-md-6">
            <span class="glyphicon glyphicon-pencil" style="font-weight:bold; font-size:15px " >&nbsp;Comments</span>
        </div>
        <div class="col-md-6 text-right">
            <a id="btnGuestbookAdd" class="btn btn-info">글 남기기</a>
        </div>
    </div>
            
    <hr />
    <div id="divGuestBookList">
        <input type="hidden" id="hidLastGuestBookIdx" name="hidLastGuestBookIdx" value="" />
    </div>
    <!-- (e) 댓글리스트 영역 (e) -->
</div>

